package com.cursino.wilson.game.card;


/**
 * The class Card, will hold a suit (heart, club, spade and diamond) and value (ace,2-10, jack, queen and king).
 * @author <a href="mailto:"wilson.cursino@gmail.com"> Wilson Soethe Cursino </a>
 * @since 1.0
 */
public class Card {
    private CardValue value;
    private CardSuit suit;

    public Card(CardValue value, CardSuit suit) {
        super();
        this.value = value;
        this.suit = suit;
    }

    public CardValue getValue() {
        return value;
    }

    public void setValue(CardValue value) {
        this.value = value;
    }

    public CardSuit getSuit() {
        return suit;
    }

    public void setSuit(CardSuit suit) {
        this.suit = suit;
    }

    @Override
    public String toString() {
        return "Card(value=" + value + ", suit=" + suit + ")";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((value == null) ? 0 : value.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Card other = (Card) obj;
        if (value != other.value)
            return false;
        return true;
    }
}